/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package editorsvg.editor.herramientas.controles;

import editorsvg.editor.formas.Pintable;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Point;

/**
 *
 * @author Jorge
 */
public class Flecha implements Pintable {
    private Point centro;
    private Point extremo;    
    
    public Flecha() {        
    }
    
    public Flecha(Point centro, Point extremo) {
        this.centro = centro;
        this.extremo = extremo;
    }
    
    @Override
    public void pintar(Graphics2D graphics) {           
        if (centro != null && extremo != null) {
            graphics.setColor(Color.BLACK);
            graphics.drawLine(centro.x, centro.y, extremo.x, extremo.y);            
        }
    }

    public Point getCento() {
        return centro;
    }

    public void setCentro(Point punto) {
        this.centro = punto;
    }

    public Point getExtremo() {
        return extremo;
    }

    public void setExtremo(Point extremo) {
        this.extremo = extremo;
    }
}
